<?php
if (($this->points) && (count($this->points) > 0)) {

    ?>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span10 offset1">
                <table class="table table-striped table-condensed">
                    <caption><h1>Mis puntos</h1></caption>
                    <thead>
                    <tr>
                        <td></td>
                        <th>Nombre</th>
                        <th>Latitud</th>
                        <th>Longitud</th>
                        <th>Elevaci&oacute;n</th>
                        <td></td>
                    </tr>
                    </thead>
                    <tbody>
                    <?php
                    foreach ($this->points as $point) {
                        echo '<tr>' .
                            '<td><a href="#img' . $point['punto'] . '" rel="modal:open"><img src="' . $point['icono'] . '" class="img-polaroid" width="100px" height="100px"></a></td>' .
                            '<td>' . $point['nombre'] . '</td>' .
                            '<td>' . $point['latitud'] . '</td>' .
                            '<td>' . $point['longitud'] . '</td>' .
                            '<td>' . $point['elevacion'] . ' msn</td>' .
                            '<td><a rel="modal:open" href="#map' . $point['punto'] . '" class="btn btn-small" id="btn-show-' . $point['punto'] . '">Localizar</a>' .
                            '</tr>';

                    }
                    ?>
                    </tbody>
                </table>
                <?php
                foreach ($this->points as $point) {
                    echo '<div id="img' . $point['punto'] . '" style="display:none;">' .
                        '<img src="' . $point['icono'] . '" class="img-polaroid" class="img-polaroid">' .
                        '</div>' .
                        '<div id="map' . $point['punto'] . '" style="display:none;">' .
                        '<img src="http://maps.googleapis.com/maps/api/staticmap?markers=' . $point['latitud'] . ',' . $point['longitud'] . '&zoom=16&size=700x500&sensor=true">' .
                        '</div>';
                }
                ?>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="/js/jquery.modal.min.js"></script>
<?php
} else {
    ?>
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span2 offset5">
                <h3>No tenés puntos registrados.</h3>
            </div>
        </div>
    </div>
<?php
}
?>